package com.fileServer.client;
import org.springframework.http.MediaTypeFactory;


/**
 * 内容协商管理器
 * @author 大忽悠
 * @create 2023/2/13 13:51
 */
public class ContentNegotiateManager {
     /**
      * 根据文件字节流获取文件的类型
      */
     public static String getMimeType(String fileName){
          try {
               return MediaTypeFactory.getMediaType(fileName).get().toString();
          } catch (Exception e) {
               e.printStackTrace();
          }
          return "application/octet-stream";
     }
}
